﻿
namespace SdmxMl.Common
{
    /// <summary>
    /// TimePeriodType specifies a point in time. TIME_PERIOD is not completely
    /// expressible in XML Schema's date type: instead we use the union of dateTime,
    /// date, gYearMonth, and gYear. Bi-annual, tri-annual, quarterly, and weekly
    /// periods have special formats (see PeriodType), but other periods would be
    /// described in terms of their beginning date or time (e.g., a period of a
    /// decade is identified with a four-digit year corresponding to the decades'
    /// first year).
    /// </summary>
    public class TimePeriodType
    {
        private string _internalStr;

        #region Constructors

        public TimePeriodType()
        {
            _internalStr = "";
            //DateTime.Now.Year.ToString();
        }

        public TimePeriodType(string s)
        {
            UpdateInternal(s);
        }

        public void UpdateInternal(string s)
        {
            // Todo: Check valid
            _internalStr = s;
        }
        #endregion

        #region String Representation

        public override string ToString()
        {
            return _internalStr;
        }
        #endregion
    }
}
